google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',473,408,null,null], ['2日',499,442,null,null], ['3日',456,436,null,null], ['4日',421,449,null,null], ['5日',418,452,null,null], ['6日',407,461,null,null], ['7日',405,437,null,null], ['8日',429,412,null,null], ['9日',450,420,null,null], ['10日',437,431,null,null], ['11日',403,458,null,null], ['12日',431,487,null,null], ['13日',458,476,null,null], ['14日',460,419,null,null], ['15日',460,422,null,null], ['16日',472,435,null,null], ['17日',451,424,null,null], ['18日',418,479,null,null], ['19日',408,468,null,null], ['20日',453,449,null,null], ['21日',427,463,null,null], ['22日',456,400,null,null], ['23日',456,412,null,null], ['24日',412,439,null,null], ['25日',406,473,null,null], ['26日',379,458,null,null], ['27日',458,480,null,null], ['28日',484,492,null,null], ['29日',490,450,null,null], ['30日',437,452,null,null], ['31日',407,null,null,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:500},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=30 -1 ; var lastlogcat=2; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });